<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page import="hmg.common.ValueHolder"%>
<%@ page import="able.com.vo.SearchVO"%>
<%@ page import="hmg.vo.CodeVO"%>
<%@ page import="hmg.vo.BoardVO"%>
<%@ page import="java.util.List"%>
<html lang="ko" xml:lang="ko" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>사실은 이렇습니다 | 현대자동차그룹</title>
<meta name="description" content="현대자동차그룹 및 계열사별 사실은 이렇습니다 게시판" />
<meta name="keywords" content="현대자동차그룹 사실은 이렇습니다, 현대차그룹 사실은 이렇습니다, 사실은 이렇습니다, Real" />
<%
    List<BoardVO> newsList = (List<BoardVO>) request.getAttribute("NewsList");
    Integer totalNews = (Integer) request.getAttribute("TotalNews");
    
    String compType = CommonUtils.getParameter(request.getParameter("compType"), "");
    String currPage = CommonUtils.getParameter(request.getParameter("page"), "1");
    String searchCondition = CommonUtils.getParameter(request.getParameter("searchCondition"), "1");
    String searchKeyword = CommonUtils.getDecodedParameter(request.getParameter("searchKeyword"), "");
%>
<%@ include file="/WEB-INF/jsp/web/kor/include/header.jspf" %>
<script type="text/javascript">
var page = "<%= currPage %>";

//<![CDATA[
$(document).ready(function(){
    if (page == "")
        page = "1";

    $("#paging").html(getNewsPagingString(<%= totalNews %>, page, 10, 10));
});

function fn_list_search() {
    var condition = $("#searchCondition").val();
    var keyword = $("#searchKeyword").val();

    if (keyword.length < 2) {
        alert("검색어를 2자 이상 입력해 주세요.");
        return;
    }

    keyword = escape(encodeURIComponent(keyword));

    document.location.href = "./RelList.do?compType=&searchCondition=" + condition + "&searchKeyword=" + keyword + "&page=1";
}

function fn_move_page(pageNo){
    fn_common_move_page(pageNo, location.search, page, 10, <%= totalNews %>, "./RelList.do");
}

//]]>
</script>
</head>
<body>
    <!--wrap-->
    <div id="wrap">
        <!-- skip navigation -->
        <div id="skipnavition">
            <a href="#gnb">메뉴바로가기</a><a href="#content">본문바로가기</a>
        </div>
        <!--// skip navigation -->

        <hr />

        <!-- header-->
        <%@ include file="/WEB-INF/jsp/web/kor/include/left.jspf" %>
        <!--//header-->

        <hr />


        <!--container-->
        <div id="container">
            <div class="scroll-pane">
            <!-- 공통 -->
            <div class="subTitle">
                <div class="pageTitle">
					<!-- 130110 수정 -->
                    <h2><img src="<%= ValueHolder.SERVER_DOMAIN %>/hmg/images/web/kor/title/group_Real_Notice.gif" alt="사실은 이렇습니다" /></h2>
                    <p class="subCopy"><img src="<%= ValueHolder.SERVER_DOMAIN %>/hmg/images/web/kor/title/group_Real_list_desc.gif" alt="현대자동차그룹에서 알려 드립니다" /></p>
					<!-- 130110 수정 -->
                </div>

                <div class="pageLocation">
                    <ul>
                        <li><a href="<%= ValueHolder.SERVER_DOMAIN %>/hmg/web/kor/Main.do"><img src="<%= ValueHolder.SERVER_DOMAIN %>/hmg/images/web/kor/common/location_home.gif" alt="홈"/></a></li>
                        <li><a href="<%= ValueHolder.SERVER_DOMAIN %>/hmg/web/kor/grn/GroupNewsSubMain.do">그룹소식</a></li>
						<!-- 130110 수정 -->
                        <li class="nowPage"><a href="<%= ValueHolder.SERVER_DOMAIN %>/hmg/web/kor/grn/ntc/realList.do">사실은 이렇습니다</a></li>
						<!-- //130110 수정 -->
                    </ul>
                </div>
            </div>
            <!--//공통-->

            <!--contents-->
            <div id="content">

            <!-- 내용 -->
            <div class="noticeList">
				<h4 style="padding-bottom:20px;"><img src="<%= ValueHolder.SERVER_DOMAIN %>/hmg/images/web/kor/grn/Real_title.jpg" alt="사실은 이렇습니다. 현대자동차그룹에서 알려드립니다." /></h4>
                <table class="boradV4" summary="사실은 이렇습니다 목록">
                    <caption>사실은 이렇습니다</caption>
                    <colgroup>
                        <col width="10%" />
                        <col width="70%" />
                        <col width="20%" />
                    </colgroup>
                    <thead>
                        <tr>
                            <th scope="col">번호</th>
                            <th scope="col">제목</th>
                            <th scope="col">등록일</th>
                        </tr>
                    </thead>
                    <tbody>
<%
    if (newsList == null || newsList.size() == 0)
        out.println("   <tr><td colspan=\"4\" style=\"text-align:center;\">등록된 게시물이 없습니다.</td></tr>");
    else {
        for (int idx = 0; idx < newsList.size(); idx++) {
            BoardVO news = newsList.get(idx);
%>
                        <tr>
                            <td><%= totalNews - ((new Integer(currPage) - 1) * 10 + idx) %></td>
                            <td class="alignL"><a href="./RelView.do?listID=<%= news.getListID() %>&page=<%= currPage %>"><%= news.getTitle() %></a></td>
                            <td><%= news.getRegDate() %></td>
                        </tr>
<%
        }
    }
%>                    
                    </tbody>
                </table>
            </div>

            <div class="gropnews_page">
                    <div class="gropnews_page_left">
                        <ul id="paging"></ul>
                    </div>

                    <div class="gropnews_page_right">
                        <ul>
                            <li><a href="javascript:fn_move_page('prev');"><img src="<%= ValueHolder.SERVER_DOMAIN %>/hmg/images/web/kor/btn/btn_prev.gif" alt="이전페이지로 이동" /></a></li>
                            <li><a href="javascript:fn_move_page('next');"><img src="<%= ValueHolder.SERVER_DOMAIN %>/hmg/images/web/kor/btn/btn_next.gif" alt="다음페이지로 이동" /></a></li>
                        </ul>
                    </div>
                </div>

                <!-- searcharea-->
                <div class="searchArea">
                    <img src="<%= ValueHolder.SERVER_DOMAIN %>/hmg/images/web/kor/grn/groupnews_Search_Text01.gif" alt="상세검색" class="search_text"/>
                    <label class="hidden" for="">검색 영역</label>
                    <select id="searchCondition">
                        <option value="1" selected>제목</option>
                        <option value="2">내용</option>
                        <option value="3">제목 + 내용</option>
                    </select>
                    <label class="hidden" for="">검색</label>
                    <input type="text" id="searchKeyword" name="searchKeyword" value="" title="검색" onkeypress="javascript:if (event.keyCode == 13) { fn_list_search(); }" />
                    <a href="javascript:fn_list_search();"><img src="<%= ValueHolder.SERVER_DOMAIN %>/hmg/images/web/kor/btn/btn_search.gif" alt="검색" class="search_btn"/></a>
                </div>
                <!--// searcharea-->

            <!--// 내용 -->


            </div>
            <!--//contents-->
        </div>
        </div>
        <!--//container-->

        <hr />

        <!--footer-->
        <%@ include file="/WEB-INF/jsp/web/kor/include/footer.jspf" %>
        <!--//footer-->
        <hr />
        <!--notice-->
        <%@ include file="/WEB-INF/jsp/web/kor/include/notice.jspf" %>
        <!--//notice-->
    </div>
    <!--//wrap-->
</body>
</html>